package com.example.app_04_activity_launchmode;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    public MainActivity() {
        Log.i(TAG, "----> MainActivity()");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.i(TAG, "----> onCreate()");
    }

    /**
     * 按钮点击事件，启动OtherActivity界面
     * @param view 发生事件的视图对象
     */
    public void startOtherActivity(View view) {
        startActivity(new Intent(this, OtherActivity.class));
    }

    /**
     * 按钮点击事件，启动MainActivity界面
     * @param view 发生事件的视图对象
     */
    public void startMainActivity(View view) {
        startActivity(new Intent(this, MainActivity.class));
    }
}